package com.eastmoney.tutorial.android.myapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
 * Created by benny.xu on 2016-03-12.
 */
public class SecondActivity extends Activity {


    private Button btn1 ;
    private String content="i am from second activity!";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second);

        btn1 = (Button) findViewById(R.id.btn1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent data =new Intent();
                data.putExtra("data",content);
                setResult(2,data);

                finish();

            }
        });
    }
}